package creationalPatterns.factory;
interface Shape{
    public void draw();
}
class Rectangle implements Shape{
    public void draw(){
        System.out.println("Rectangle");
    }
}
class Circle implements Shape{
    public void draw(){
        System.out.println("Circle");
    }
}
class ShapeFactory{
    public Shape getShape(String shapeType){
        if(shapeType.equalsIgnoreCase("Rectangle")){
            return new Rectangle();
        }
        else if(shapeType.equalsIgnoreCase("Circle")){
            return new Circle();
        }
        return null;
    }
}
public class FactoryPattern{
    public static void main(String[] args){
        ShapeFactory sf = new ShapeFactory();
        Shape s = sf.getShape("Rectangle");
        s.draw();
    }
}